﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;

namespace Web.manager
{
    public partial class loginlog : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SetDivePage(ref GridView1, ref GV);
            if (!IsPostBack)
            {
                //Hashtable user = PhoneBook.Users.Users.get(Commons.StrUtil.FormatValue(Session["userid"]));
                //DataSet roles = PhoneBook.Manage.SysRole.getGroupRole(user["groupid"].ToString());
                //Commons.ControlUtil.BindDDL(ddl_roleid, roles, "rolename", "roleid");

                this.txtStartTime.MyDateValue = DateTime.Now.AddDays(-1).ToString();
                this.txtEndTime.MyDateValue = DateTime.Now.AddDays(2).ToString();
                QueryData();
            }
        }

        public override void QueryData()
        {
            long usertype=Convert.ToInt64(this.ddl_roleid.SelectedValue);
            string username=this.txb_keyword.Text;
            DateTime starttime = Convert.ToDateTime(this.txtStartTime.MyDateValue);
            DateTime endtime = Convert.ToDateTime(this.txtEndTime.MyDateValue);
            DataSet ds = PhoneBook.Manage.LoginLog.listloginlog(usertype,username,starttime,endtime);
            //绑定数据集
            GVDataBind(ref GridView1, ref GV, ds);
        }

        protected void btn_save_Click(object sender, EventArgs e)
        {
            QueryData();
        }
    }
}